import yaml
import os

def load_yaml_config(config_file='config.yaml'):
    config_path = os.path.join(os.path.dirname(__file__), config_file)
    with open(config_path, 'r', encoding='utf-8') as file:
        config = yaml.safe_load(file)
    return config

# 示例用法
config = load_yaml_config()
print(config)

# 访问嵌套值
option1 = config['settings']['option1']
nested_value = config['settings']['nested']['level1']['level2']
print(f"Option1: {option1}")
print(f"Nested Value: {nested_value}")